<%@ page import="module.blog.Link" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main" />
    <title>Create Link</title>
  </head>
  <body>
    <div class="nav">
      <span class="menuButton"><a class="home" href="${createLink(url:'/')}">首页</a></span>
      <span class="menuButton"><g:link class="list" action="list">Link List</g:link></span>
    </div>
    <div class="body">
      <h1>Create Link</h1>
      <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
      </g:if>
      <g:hasErrors bean="${linkInstance}">
        <div class="errors">
          <g:renderErrors bean="${linkInstance}" as="list" />
        </div>
      </g:hasErrors>
      <g:form action="save" method="post" >
        <div class="dialog">
          <table>
            <tbody>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="catalog">Catalog:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean:linkInstance,field:'catalog','errors')}">
            <g:select name="catalog" from="${linkInstance.constraints.catalog.inList}" value="${linkInstance?.catalog}" valueMessagePrefix="link.catalog"  />
            </td>
            </tr>

            <tr class="prop">
              <td valign="top" class="name">
                <label for="link">Link:</label>
              </td>
              <td valign="top" class="value ${hasErrors(bean:linkInstance,field:'link','errors')}">
            <g:textField name="link" value="${linkInstance?.link}" />
            </td>
            </tr>

            <tr class="prop">
              <td valign="top" class="name">
                <label for="order">Order:</label>
              </td>
              <td valign="top" class="value ${hasErrors(bean:linkInstance,field:'order','errors')}">
            <g:textField name="order" value="${fieldValue(bean: linkInstance, field: 'order')}" />
            </td>
            </tr>

            <tr class="prop">
              <td valign="top" class="name">
                <label for="title">Title:</label>
              </td>
              <td valign="top" class="value ${hasErrors(bean:linkInstance,field:'title','errors')}">
            <g:textField name="title" value="${linkInstance?.title}" />
            </td>
            </tr>

            </tbody>
          </table>
        </div>
        <div class="buttons">
          <span class="button"><input class="save" type="submit" value="Create" /></span>
        </div>
      </g:form>
    </div>
  </body>
</html>
